public class quick234 {
    public void quick(int[] array, int start, int end) {
        if (start >= end) {
            return;
        }
        int pivot = passion(array, start, end);
        quick(array, start, end - 1);
        quick(array, start + 1, end);
    }

    private int passion(int[] array, int left, int right) {
        int tem = array[left];
        int i = left;
        while (left <= right) {
            while (left < right && array[right] >= tem) {
                right--;
            }
            while (left < right && array[left] <= tem) {
                left++
            }
            swap(array, left, right);
        }
        swap(array, i, left);
        return left;
    }

    private void swap(int[] array, int i, int left) {
        int tem = array[i];
        array[i] = array[left];
        array[left] = tem;
    }
}